using Electric.Service.Commons;
using ElectricExceptions;
using Microsoft.Extensions.Logging;

namespace Electric.Service.Orders;

public class OrderService : BaseService, IOrderService
{
    private readonly ILogger<OrderService> _logger;

    public OrderService(ILogger<OrderService> logger)
    {
        _logger = logger;
    }

    public string GetById(int id)
    {
        if (id < 0)
        {
            throw new BusinessException("id值不能小于0",$"id={id} < 0,this is exception from service");
        }
        return $"orders from service, id = {id}";
    }
}
